<template>
  <div class="bar-charts" ref="chart"></div>
</template>

<script>
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
export default {
  name: 'ProgessChart',
  mixins: [resize],
  mounted() {
    const myEcharts = echarts.init(this.$refs.chart)
    myEcharts.setOption({
      grid: {
        left: 0,
        right: 0
      },
      xAxis: {
        show: false,
        min: 0,
        max: 100
      },
      yAxis: {
        type: 'category',
        show: false,
        data: ['数据']
      },
      series: {
        type: 'bar',
        data: [78],
        // 柱状图的颜色
        itemStyle: {
          color: 'yellowgreen'
        },
        // 柱状图的宽度
        barWidth: 10,
        // 柱状图的背景颜色
        showBackground: true,
        // 柱状图的内容
        label: {
          // 显示
          show: true,
          // 显示的内容
          formatter: '|',
          // 显示的位置
          position: 'right',
          // 颜色
          color: 'yellowgreen'
        }
      }
    })
  }
}
</script>

<style lang="scss" scoped>
.bar-charts {
  width: 100%;
  height: 100%;
}
</style>
